<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fun"%>
<html>
<head>
    <title>智能门禁替换</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css"
          rel="stylesheet"/>
    <link href="//cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">          

    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
	<script src="//cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
	<script type="text/javascript"
            src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"></script>
			 <style >
		.jqGrid_wrapper{*+margin-left:270px;}
	
		.lt{float:left}
		.form-group{*+overflow:hidden;}
		.form-group label{width:28%\9;*+width:20%;text-align:right\9;*+text-align:right;}
		.col-sm-8 .m-t2 {width:22%\9;}
		.form-group .col-sm-8{width:66%\9;*+width:66%;}
		.form-group .form-control{*+width:95%;}
		
	</style>
</head>
<body>
<div class="col-sm-12">
    <form class="form-horizontal m-t" id="form" method="post"
          action="${pageContext.request.contextPath}/admin/tlocks_saveChange.action">
        <input type="hidden" name="sid" value="${map.sid}">
        <input type="hidden" name="beforeunit" id="beforeunit" value="${map.unit}">
         <div class="form-group">
            <label class="col-sm-3  control-label lt"><i class="require">*</i>原门禁PID:</label>
            <div class="col-sm-8 lt">
                <input class="form-control" name="pid" size="30" value="${map.pid}" disabled="disabled"/>
            </div>
         </div>
         <div class="form-group">
            <label class="col-sm-3  control-label lt"><i class="require">*</i>新门禁PID:</label>
            <div class="col-sm-8 lt">
               <input class="form-control" name="newPid" id="newPid"  size="30" />
            </div>
        </div>
         <div class="form-group">
            <label class="col-sm-3  control-label lt"><i class="require">*</i>激活码:</label>
            <div class="col-sm-8 lt">
               <input class="form-control" name="checkcode" id="checkcode"  size="30" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label lt"><i class="require">*</i>门禁名称:</label>
            <div class="col-sm-8 lt">
                <input class="form-control" name="installLockName" id="installLockName" size="30" value="${map.install_lock_name}" disabled="disabled"/>
            </div>
        </div>
        <div class="form-group">
        	&nbsp;&nbsp;&nbsp;&nbsp;温馨提示：更换智能门禁后，需要APP用户重新刷新钥匙才能开门。
        </div>
    </form>
</div>
<script type="text/javascript">
function result(){
	   var bootstrapValidator = $("#form").data('bootstrapValidator');
	   bootstrapValidator.validate();
	   return bootstrapValidator.isValid();

}

$(function () {
	$('form').bootstrapValidator({
		message:'this value is not valid',
            fields: {
            	newPid: {
                    message: 'pid验证失败',
                    validators: {
                        notEmpty: {
                            message: '新门禁PID不能为空'
                        }
                    }
                },
                checkcode: {
                    validators: {
                        notEmpty: {
                            message: '激活码不能为空'
                        }
                    }
                }
            }
        });
});
</script>
</body>
</html>
